home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / rexmooslib.lha / MOOS / Install_MOOS < prev    next >
Text File  |  1997-02-02  |  7KB  |  236 lines

  1. ;
  2. ; Copyright © 1994-1997 Rocco Coluccelli
  3. ; $VER: InstallMOOS 1.00 (29.Jan.1997)
  4. ;
  5.  
  6. ;
  7. ;    ============
  8. ;    Localization
  9. ;    ============
  10. ;
  11. (if (= @language "english")
  12. (
  13.     (set ##welcome (cat
  14.         "\n\n\nThe MOOS library\nVersion 1.1\n\n\n"
  15.         "MOOS © 1994-1997 to Rocco Coluccelli\n"
  16.         "All rights reserved to the author."
  17.     ))
  18.     (set ##bad-kick "\nSorry, but the MOOS package requires at last the AmigaOS 2.04 installed in your system.\n")
  19.     (set ##copying "I'm going to copy: ")
  20.     (set ##install "Which part of the MOOS package do you need to install, or update?")
  21.     (set ##install-hlp (cat
  22.         "    The main MOOS library is an ARexx external functions library that let users access to dozen of functions contained into its sub-libraries. Read the documentation for more details.\n\n"
  23.         "    The MOOS modules are ARexx scripts used as external functions. Every library into the MOOS package has a test script that show the use of each function contained (the output text is also provided).\n\n"
  24.         "    To use any function contained into the MOOS package, into your own script, you probably need to install the documentation files...\n\n"
  25.     ))
  26.     (set ##inst-libs "MOOS libraries in libs:")
  27.     (set ##inst-mods "MOOS modules in rexx:")
  28.     (set ##inst-docs "Documentation files.")
  29.     (set ##inst-docs-lang "Which versions of the documentation files you need to install?")
  30.     (set ##inst-docs-dest "Choose a destination for the documentation files. A drawer \"MOOS\" will be created if it doesn't exists.")
  31.     (set ##inst-test "Test ARexx scripts.")
  32.     (set ##inst-test-dest "Choose a destination drawer for all test scripts.")
  33. ))
  34.  
  35. (if (= @language "italiano")
  36. (
  37.     (set ##welcome (cat
  38.         "\n\n\nLa libreria MOOS\nVersione 1.1\n\n\n"
  39.         "MOOS © 1994-1997 di Rocco Coluccelli\n"
  40.         "Tutti i diritti sono riservati."
  41.     ))
  42.     (set ##bad-kick "\nMi dispiace, ma tutto il pacchetto MOOS richiede che nel sistema sia installata almeno la versione 2.04 di AmigaOS.\n")
  43.     (set ##copying "Sto per copiare: ")
  44.     (set ##install "Quale parte del pacchetto MOOS desideri che venga installata, o aggiornata?")
  45.     (set ##install-hlp (cat
  46.         "    La libreria principale di MOOS e' una libreria di funzioni esterne richiamabili dall'interno di script ARexx. Essa e', in realta', un indice di decine di funzioni contenute in tante sotto-librerie. Si legga la documentazione per i dettagli.\n\n"
  47.         "    I moduli MOOS sono script ARexx usabili come funzioni esterne, sempre richiamabili dall'interno di altri script ARexx. Ogni libreria, nel pacchetto software MOOS, ha anche uno script dimostrativo che mostra anche l'uso delle funzioni contenute (ogni script e' affiancato da un file contenente l'output prodotto).\n\n"
  48.         "    Per usare le funzioni contenute nel pacchetto applicativo MOOS sono anche disponibili dei file di documentazione (in versione italiana ne mancano ancora molti, mi spiace).\n\n"
  49.     ))
  50.     (set ##inst-libs "Le librerie MOOS in libs:")
  51.     (set ##inst-mods "I moduli MOOS in rexx:")
  52.     (set ##inst-docs "Tutta la documentazione.")
  53.     (set ##inst-docs-lang "Quali versioni della documentazione vuoi installare?")
  54.     (set ##inst-docs-dest "Scegli una destinazione per i file della documentazione. Un nuovo cassetto \"MOOS\" sara' creato se non gia' presente.")
  55.     (set ##inst-test "Script ARexx di test.")
  56.     (set ##inst-test-dest "Scegli una destinazione per tutti gli script di test.")
  57. ))
  58.  
  59.  
  60. ;
  61. ;    =======
  62. ;    WELCOME
  63. ;    =======
  64. ;
  65. (complete 0)
  66. (message ##welcome (all))
  67. (welcome)
  68.  
  69. ;
  70. ;    Check kick version
  71. ;
  72. (if (= (set #flag (/ (getversion "libs:version.library") 65536)) 0)
  73.     (set #flag (/ (getversion) 65536))
  74. )
  75.  
  76. (if (< #flag 37) (abort ##bad-kick))
  77.  
  78. ;
  79. ;    CPU & FPU
  80. ;
  81. (set cpu (database "cpu"))
  82. (set fpu (database "fpu"))
  83.  
  84. ;
  85. ;    source and destination dir
  86. ;
  87. (set #srcdir (pathonly @icon))
  88. (set @default-dest "REXX:")
  89.  
  90.  
  91. ;
  92. ;    ================================================
  93. ;    the /Libs  directory with libraries...
  94. ;    the /ARexx directory with modules...
  95. ;    the /Docs  directory with documentation files...
  96. ;    the /Tests directory with test ARexx scripts...
  97. ;    ================================================
  98. ;
  99. (set #inst 0)
  100.  
  101. (if (> (exists (set #libs-dir (tackon #srcdir "Libs"))) 0)
  102.     (set #inst (+ #inst 1))
  103.     (set ##inst-libs "")
  104. )
  105. (if (> (exists (set #mods-dir (tackon #srcdir "ARexx"))) 0)
  106.     (set #inst (+ #inst 2))
  107.     (set ##inst-mods "")
  108. )
  109. (if (> (exists (set #docs-dir (tackon #srcdir "Docs"))) 0)
  110.     (if (= @user-level 2) (set #inst (+ #inst 4)))
  111.     (set ##inst-docs "")
  112. )
  113. (if (> (exists (set #test-dir (tackon #srcdir "Tests"))) 0)
  114.     (if (= @user-level 2) (set #inst (+ #inst 8)))
  115.     (set ##inst-test "")
  116. )
  117.  
  118. (set #inst
  119.     (askoptions
  120.         (prompt ##install)
  121.         (help (cat ##install-hlp "\n" @askoptions-help))
  122.         (choices ##inst-libs ##inst-mods ##inst-docs ##inst-test)
  123.         (default #inst)
  124.     )
  125. )
  126. (complete 5)
  127.  
  128.  
  129. (if (in #inst 0)
  130.     (foreach #libs-dir "#?.library"
  131.         (copylib
  132.             (prompt (cat ##copying @each-name))
  133.             (help @copylib-help)
  134.             (source (tackon #libs-dir @each-name))
  135.             (dest "LIBS:")
  136.             (confirm)
  137.         )
  138.     )
  139. )
  140. (complete 20)
  141.  
  142.  
  143. (if (in #inst 1)
  144.     (copyfiles
  145.         (prompt (cat ##copying "ARexx/#?"))
  146.         (help @copyfiles-help)
  147.         (source #mods-dir)
  148.         (dest "REXX:")
  149.         (all)
  150.         (confirm)
  151.     )
  152. )
  153. (complete 40)
  154.  
  155. (set #docs-dest "Work:")
  156. (if (in #inst 2)
  157. (
  158.     (set #lang 0)
  159.  
  160.     (set #it "Italiano")
  161.     (if (> (exists (tackon #docs-dir #it)) 0)
  162.         (set #lang (+ #lang 1)) (set #it "")
  163.     )
  164.     (set #gb "English")
  165.     (if (> (exists (tackon #docs-dir #gb)) 0)
  166.         (set #lang (+ #lang 2)) (set #gb "")
  167.     )
  168.     (set #de "Deutsch")
  169.     (if (> (exists (tackon #docs-dir #de)) 0)
  170.         (set #lang (+ #lang 4)) (set #de "")
  171.     )
  172.  
  173.     (set #lang (askoptions
  174.         (prompt ##inst-docs)
  175.         (help @askoptions-help)
  176.         (choices #it #gb #de)
  177.         (default #lang)
  178.     ))
  179.  
  180.     (if (> #lang 0)
  181.     (
  182.         (set #docs-dest (tackon (askdir
  183.             (prompt ##inst-docs-dest)
  184.             (help @askdir-help)
  185.             (disk)
  186.             (default "Work:")) "MOOS/Docs")
  187.         )
  188.  
  189.         (if (= (exists #docs-dest) 0) (makedir #docs-dest (infos)))
  190.  
  191.         (set @default-dest (pathonly #docs-dest))
  192.     ))
  193.  
  194.     (set #n 0)
  195.     (while (< #n 3)
  196.     (
  197.         (if (in #lang #n)
  198.             (copyfiles
  199.                 (source (tackon #docs-dir (select #n #it #gb #de)))
  200.                 (dest (tackon #docs-dest (select #n #it #gb #de)))
  201.                 (all)
  202.             )
  203.         )
  204.         (set #n (+ #n 1))
  205.     ))
  206. ))
  207. (complete 60)
  208.  
  209. (set @default-dest (pathonly #docs-dest))
  210. (if (in #inst 3)
  211.     (copyfiles
  212.         (prompt ##inst-test)
  213.         (help @copyfiles-help)
  214.         (source #test-dir)
  215.         (dest (askdir
  216.             (prompt ##inst-test-dest)
  217.             (help @askdir-help)
  218.             (default @default-dest)
  219.         ))
  220.         (pattern "#?.(rexx|output)")
  221.         (infos)
  222.         (confirm)
  223.     )
  224. )
  225. (complete 80)
  226.  
  227.  
  228. ;
  229. ;    ===========
  230. ;    All done...
  231. ;    ===========
  232. ;
  233. (complete 100)
  234. (exit)
  235.  
  236.